using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DataLoad.iContact.WinClient.Properties;

namespace DataLoad.iContact.WinClient
{
    public partial class frmAskMinimise : Form
    {
        public frmAskMinimise()
        {
            InitializeComponent();
        }

        public new static DialogResult Show()
        {
            using (frmAskMinimise frm = new frmAskMinimise())
            {
                DialogResult result = frm.ShowDialog();

                if (frm.chkDontAsk.Checked)
                {
                    if (result == DialogResult.Yes)
                    {
                        Settings.Default.MinimiseOnClose = MinimiseOnCloseOptions.Yes.ToString();
                    }
                    else if (result == DialogResult.No)
                    {
                        Settings.Default.MinimiseOnClose = MinimiseOnCloseOptions.No.ToString();
                    }
                }
                else
                {
                    Settings.Default.MinimiseOnClose = MinimiseOnCloseOptions.Ask.ToString();
                }

                Settings.Default.Save();

                return result;
            }
        }
    }
}